package com.kehutong.auth.controller;

import com.kehutong.auth.entity.AccountOperateLog;
import com.kehutong.common.util.Token;
import org.coraframework.inject.Inject;
import org.coraframework.json.JSONObject;
import org.coraframework.logger.Logger;
import org.coraframework.logger.LoggerFactory;
import org.coraframework.mvc.MvcAction;
import org.coraframework.mvc.http.ReqMapping;
import org.coraframework.orm.jdbc.JdbcSession;
import org.coraframework.orm.jdbc.Page;

/**
 * 操作日志
 *
 * @author: liukunlong
 * @date: 2021-08-13 09:21
 */
@MvcAction
@ReqMapping("/admin/account/operate/log")
public class AccountOperateLogController {
    private static final Logger logger = LoggerFactory.getLogger(AccountOperateLogController.class);

    @Inject
    private JdbcSession jdbcSession;

    /**
     * 用户操作日志列表
     *
     * @param jsonObject
     * @return
     * @throws Exception
     */
    @ReqMapping("/page")
    public Object getAccountOperateLogList(Token token, JSONObject jsonObject) throws Exception {
        Page<AccountOperateLog> page = jdbcSession.findPage(AccountOperateLog.class)
                .eq("deleted", false)
                .eq(jsonObject, "id", "accountNo")
                .order("createTime", "desc")
                .page(jsonObject)
                .exe();
        return page;
    }
}
